A First-Order One-Pass CPS Transformation
نویسندگان
چکیده
We present a new transformation of call-by-value lambda-terms into continuation-passing style (CPS). This transformation operates in one pass and is both compositional and first-order. Because it operates in one pass, it directly yields compact CPS programs that are comparable to what one would write by hand. Because it is compositional, it allows proofs by structural induction. Because it is first-order, reasoning about it does not require the use of a logical relation. This new CPS transformation connects two separate lines of research. It has already been used to state a new and simpler correctness proof of a direct-style transformation, and to develop a new and simpler CPS transformation of control-flow information. ∗Extended version of an article to appear in the proceedings of FOSSACS’02, Grenoble, France, April 2002. †Basic Research in Computer Science (www.brics.dk), funded by the Danish National Research Foundation. ‡Ny Munkegade, Building 540, DK-8000 Aarhus C, Denmark. E-mail: {danvy,lrn}@brics.dk
منابع مشابه
A Simple Correctness Proof of the Direct-Style Transformation
We build on Danvy and Nielsen’s first-order program transformation into continuation-passing style (CPS) to present a new correctness proof of the converse transformation, i.e., a one-pass transformation from CPS back to direct style. Previously published proofs were based on CPS transformations that were either higher-order, noncompositional, or operating in two passes, and were correspondingl...
متن کاملA !rst-order one-pass CPS transformation
We present a new transformation of -terms into continuation-passing style (CPS). This transformation operates in one pass and is both compositional and !rst-order. Previous CPS transformations only enjoyed two out of the three properties of being !rst-order, one-pass, and compositional, but the new transformation enjoys all three properties. It is proved correct directly by structural induction...
متن کاملCPS transformation of beta-redexes
The extra compaction of the most compacting CPS transformation in existence, which is due to Sabry and Felleisen, is generally attributed to (1) making continuations occur first in CPS terms and (2) classifying more redexes as administrative. We show that this extra compaction is actually independent of the relative positions of values and continuations and furthermore that it is solely due to ...
متن کاملOn proving syntactic properties of CPS
Higher-order program transformations raise new challenges for proving properties of their output, since they resist traditional, rst-order proof techniques. In this work, we consider (1) the \one-pass" continuation-passing style (CPS) transformation, which is second-order, and (2) the occurrences of parameters of continuations in its output. To this end, we specify the one-pass CPS transformati...
متن کاملA Higher-Order Colon Translation
A lambda-encoding such as the CPS transformation gives rise to administrative redexes. In his seminal article “Call-by-name, call-by-value and the lambda-calculus”, 25 years ago, Plotkin tackled administrative reductions using a so-called colon translation. In “Representing control, a study of the CPS transformation”, 15 years later, Danvy and Filinski integrated administrative reductions in th...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید
ثبت ناماگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید
ورودعنوان ژورنال:
- Theor. Comput. Sci.
دوره 308 شماره
صفحات -
تاریخ انتشار 2002